#!/bin/sh
set -e

SOURCES_DIR=/tmp/artifacts
SCRIPT_DIR=$(dirname "${0}")
ADDED_DIR="${SCRIPT_DIR}"/added

unzip "${SOURCES_DIR}"/management-console-quarkus-app.zip -d "${KOGITO_HOME}"/bin/
cp -rv "${ADDED_DIR}"/launch/* "${KOGITO_HOME}"/launch/

chown -R 1001:0 "${KOGITO_HOME}"
chmod -R ug+rwX "${KOGITO_HOME}"

cp -v "${ADDED_DIR}"/kogito-app-launch.sh "${KOGITO_HOME}"
chmod +x-w "${KOGITO_HOME}"/kogito-app-launch.sh

